package com.ferryc.modules.sys.entity;

import java.util.Date;

import com.ferryc.commons.entity.DataEntity;

/**
 * 
 * 类名: SysLogInfoParam <br/>
 * 作用： <br/>
 * 方法： <br/>
 * 创建者: Ferry C <br/>
 * 添加时间: 2017年11月07日 08:14:42 <br/>
 * 
 */
@SuppressWarnings("serial")
public class SysLogInfo extends DataEntity<SysLogInfo> {

	/**
	 * 日志类型,1：接入日志；2：错误日志
	 * 
	 * @author ferry
	 *
	 */
	public enum InfoType {
		ACCESS("1", "接入日志"), EXCEPTION("2", "错误日志");

		private String value;

		private String name;

		private InfoType(String value, String name) {
			this.value = value;
			this.name = name;
		}

		public String getValue() {
			return value;
		}

		public String getName() {
			return name;
		}
	}

	/** 菜单 */
	private String menu;

	/** RequestUri */
	private String requestUri;

	/** IpAddr */
	private String ipAddr;

	/** 日志类型，1正常，2异常 */
	public String type;

	/** 操作方式 */
	private String method;

	/** UserAgent */
	private String userAgent;

	/** 请求参数 */
	private String params;

	/** 异常信息 */
	private String exception;

	/** TimeConsuming */
	private String timeConsuming;

	/** 日志类型 */
	private String typeName;
	private Date startDate;

	private Date endDate;

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getTypeName() {
		for (InfoType c : InfoType.values()) {
			if (c.value.equals(type)) {
				return c.name;
			}
		}
		return "";
	}

	public String getMenu() {
		return menu;
	}

	public void setMenu(String menu) {
		this.menu = menu;
	}

	public String getRequestUri() {
		return requestUri;
	}

	public void setRequestUri(String requestUri) {
		this.requestUri = requestUri;
	}

	public String getIpAddr() {
		return ipAddr;
	}

	public void setIpAddr(String ipAddr) {
		this.ipAddr = ipAddr;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getUserAgent() {
		return userAgent;
	}

	public void setUserAgent(String userAgent) {
		this.userAgent = userAgent;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public String getException() {
		return exception;
	}

	public void setException(String exception) {
		this.exception = exception;
	}

	public String getTimeConsuming() {
		return timeConsuming;
	}

	public void setTimeConsuming(String timeConsuming) {
		this.timeConsuming = timeConsuming;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}